<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp"%>
<%@include file="/common/repairAddress.jsp" %>
<!DOCTYPE html>
<html>
<head>
<title>病害及处置--${fns:getConfig('productName')}</title>
<%@include file="/common/uihead.jsp" %>
<style type="text/css">
.ui-jqgrid tr.jqgrow td {
text-overflow : ellipsis;
}
</style>
<%@ include file="/common/jqGridHead.jsp"%>
</head>

<body>
<ul class="nav nav-tabs" style="margin:0 4px 4px 4px;">
		<c:forEach items="${list}" var="menu"  varStatus="idxStatus">
			<li class="${menu.tag eq tag?'active':''}">
				<a href="${ctx}/${menu.href}${fn:indexOf(menuChild.href, '?') eq -1?'?':'&'}left=${fns:encodeParamUrl(left)}&top=${fns:encodeParamUrl(top)}&parentId=${fns:encodeParamUrl(parentId)}&LId=${fns:encodeParamUrl(LId)}&filter_EQS_tag=${menu.tag}">
					<i class="icon icon-list" style="margin-right:10px"></i><span>${menu.name}</span>
				</a>
			</li>
		</c:forEach>
</ul>
    <tags:message content="${msg}" />
	<form id="mainForm" name="mainForm" class="form-horizontal" role="form" method="post" >
	<div class="breadcrumb form-search" style="background-color: #f5f5f5;">
			<div>
				<label>关键字:</label>
				<input type="text" oninput="queryForGrid('mainForm','jqGrid')" onporpertychange="queryForGrid('mainForm','jqGrid')"  name="filter_LIKES_roundName_OR_manageOrg_OR_maintainOrg_OR_supervisionOrg" value="${filter_LIKES_roundName_OR_manageOrg_OR_maintainOrg_OR_supervisionOrg}" placeholder="病害信息关键信息" />
			</div>
	</div>   
 <table id="jqGrid"></table>
 <div id="jqGridPager"></div>
 </form>
<script type="text/javascript"> 
    var jqgridH =$(window).height()-340;
    $(document).ready(function () {
    	$("#jqGrid").jqGrid(
    			{ url : '${ctx}/disease/list.do?filter_EQS_damageKind=1',
    			  mtype : "GET",
    			  datatype : "json",
    			  page : 1,
    			  viewrecords: true,
    			  colModel:[{
    					label: '操作',
    					align:'center',
    					classes:'ui-jqgrid-optClass',
    		            name: 'caseNo',
//     		            hidden:true,
    		            width: 100,
    		            formatter: function (cellValue, options, rowObject){
    		        	var editUrl="${repairAddress}/inspection/damagedisease!getDetail.action?caseNo="+cellValue;
    		        	return "<a href='"+editUrl+"' target='_blank' title='查看'><i class='icon-eye' style='margin-top:2px;'></i>&nbsp;查看</a>";
    		               }
    		         },{
    		           	label : "案件号",
    					name : 'caseNumber',
    					hidden:true,
    					align : 'center',
    					width : 120,
    					sortable : true
    			     },{
    					label : "设施名称 ",
    					name : 'roundName',
    					align : 'center',
    					width : 180,
    					sortable : true,
    				 },{
    					label : "问题描述",
    					name : 'describe',
    					align:'center',
    					width : 250,
    					sortable : true
    				},{
    					label : "发现时间",
    					name : 'foundTime',
    					align:'center',
    					width : 130,
    					sortable : true
    				},{
    					label : "发现类别",
    					name : 'foundType',
    					align:'center',
    					width : 100,
    					formatter : function (cellValue) {
    						return Pengtu.buildCodeName("3005", cellValue)
    					},
    					sortable : true
    				},{
    					label : "养护标段",
    					name : 'mainDistrict',
    					align:'center',
    					width : 100,
    					sortable : true
    				},{
    					label : "养护单位",
    					name : 'maintainOrg',
    					align : 'center',
    					width : 175,
    					sortable : true
    				}, {
    					label : "损坏类型",
    					name : 'damageType',
    					align:'center',
    					width : 100,
    					sortable : true,
    					formatter : function (cellValue) {
    						return Pengtu.buildCodeName("3003", cellValue)
    					}
    				},{
    					label : "处置方法",
    					name : 'dispose',
    					align:'center',
    					width : 100,
    					sortable : true,
    					formatter : function (cellValue) {
    						return Pengtu.buildCodeName("3007", cellValue)
    					}
    				},{
    					label: '区域',
    		            name: 'district',
    		            formatter:function(cellValue){
    		            	return Pengtu.buildCodeName(2050,cellValue);
    		            },
    		            align: 'center',
    		            width: 100
    		        },{
    					label : "街道",
    					name : 'subdistrict',
    					align:'center',
    					width : 100,
    					sortable : true
    				},{
    					label : "位置信息",
    					name : 'location',
    					align:'center',
    					width : 100,
    					sortable : true
    				},{
    					label : "设施类别",
    					name : 'damageKind',
    					align:'center',
    					width : 100,
    					formatter : function (cellValue) {
    						return Pengtu.buildCodeName("3001", cellValue)
    					},
    					sortable : true
    				},{
    					label : "设备编号",
    					name : 'device',
    					align:'center',
    					width : 100,
    					sortable : true
    			    },{
    					label : "设施等级",
    					name : 'roundGrade',
    					align:'center',
    					width : 100,
    					sortable : true,
    					formatter : function (cellValue, options, rowObject) {
    						var damageKind = rowObject.damageKind;
    						if(damageKind!=null){
    							if(damageKind=="2"){
    								return Pengtu.buildCodeName("2026", cellValue)
    							}else if(damageKind=="1"||damageKind=="3"){
    								return Pengtu.buildCodeName("2010", cellValue)
    							}
    							return cellValue;
    						}
    						return cellValue;
    					}
    				},{
    					label : "部件名称",
    					name : 'partName',
    					align:'center',
    					width : 100,
    					sortable : true,
    					formatter : function (cellValue) {
    						return Pengtu.buildCodeName("3002", cellValue)
    					}
    				},{
    					label : "发现人",
    					name : 'founder',
    					align:'center',
    					width : 100,
    					sortable : true
    				},{
    					label : "联系电话 ",
    					name : 'phone',
    					align:'center',
    					width : 100,
    					sortable : true
    				},{
    					label : "复核时间",
    					name : 'assignDate',
    					align:'center',
    					width : 130,
    					sortable : true
    				},{
    					label : "复核人",
    					name : 'assigner',
    					align:'center',
    					width : 100,
    					sortable : true
    				},{
    					label : "管养单位",
    					name : 'manageOrg',
    					align:'center',
    					width : 100,
    					sortable : true
    				},{
    					label : "监管单位",
    					name : 'supervisionOrg',
    					align:'center',
    					width : 175,
    					sortable : true
    				},{
    					label : "标志物",
    					name : 'landmark',
    					align:'center',
    					width : 175,
    					sortable : true
    				},{
    					label : "处理日期",
    					name : 'dealDate',
    					align:'center',
    					width : 130,
    					sortable : true
    				},{
    					label : "处理状态",
    					name : 'isdeal',
    					align:'center',
    					width : 100,
    					formatter : function (cellValue) {
    						return Pengtu.buildCodeName("3000", cellValue)
    					},
    					sortable : true
    				},{
    					label : "资金来源",
    					name : 'maintainSource',
    					align:'center',
    					width : 100,
    					sortable : true,
    					formatter : function (cellValue) {
    						return Pengtu.buildCodeName("2002", cellValue)
    					}
    				},{
    					label : "备注",
    					name : 'remark',
    					align:'center',
    					width : 100,
    					sortable : true
    				}],
    			autowidth : false,width:$(window).width()-248, height : jqgridH,scrollOffset:0, shrinkToFit : 400, rowNum : 10, viewrecords : true, rownumbers : true,
    			jsonReader:{
        			root: "result",
        			page: "currentPage",
        			total: "totalPages",
        			records: "totalCount",
        			repeatitems: true,
        			cell: "cell",
        			id: "id",
        			userdata: "userdata",
        			subgrid: {root:"results", repeatitems: true, cell:"cell"}
        		},
        		prmNames: {
    				page:"pageNo",
    				rows:"pageSize",
    				sort: "orderBy",
    				order: "order",
    				search:"_search",
    				nd:"nd", id:"id",
    				oper:"oper",
    				editoper:"edit",
    				addoper:"add",
    				deloper:"del",
    				subgridid:"id",
    				npage: null,
    				totalrows:"totalCounts"
    			}, 
    			rowList :[10,20,30], 
    			pager : "#jqGridPager"
    			});
//         $("#jqGrid").navGrid("#jqGridPager",
//             { edit: false, add: false, del: false, search: false, refresh: true, view: false, align: "left" },
//             { closeAfterEdit: true }
//           ).jqGrid("setFrozenColumns");
    });
//          $("#messageBox").fadeToggle(1000);
//          function query(){
//       		document.mainForm.mcId.value=$('#menuId').val();
//       		queryForGrid('mainForm','jqGrid');
//       	}  
 </script>
</body>
</html>